The text export and import components provide new features that make it easier to work with the data in a text track in a QuickTime movie. Text descriptors are formatting commands that you can embed within a text file. Time stamps describe a text sample's starting time and duration.
The text export and import components now make it easier to edit and format text using an external tool, such as a text editor or word processor. When you export text from a text track, you can optionally export text descriptors and time stamps for the text. You can open the text file in a word processor and make changes to the text, style, color, and time stamps. You can then import the edited text to a text track where all the timing, style, color and time stamp information will be present.
When you export text, you control whether text descriptors and time stamps are to be exported by selecting the appropriate options in the text export settings dialog box, shown in Figure 1 . To display this dialog box programmatically, you call the MovieExportDoUserDialog function, described in Inside Macintosh: QuickTime Components .
Based on the options you specify in the text export settings dialog box, the text export component is assigned one of three text export option constants: kMovieExportTextOnly , kMovieExportAbsoluteTime , or kMovieExportRelativeTime .
Figure 1 Text export settings dialog box
If you choose "Show Text Only," the text component is assigned the export option constant kMovieExportTextOnly . In this case, the text component exports only text samples, without text descriptors or time stamps. This option is useful when you want to export only the text from a movie and you do not intend to import the text back into a movie.
If you select "Show Text, Descriptors, and Time," the text component is assigned one of two export option constants, depending on the format you specify for time stamps:
In both cases, text export component exports text, along with both text descriptors and time stamps. For more information about time stamps, see "Time Stamps" .
The text export component provides two functions you can use to access the component's text export option programmatically. To retrieve the current value of the text export option, you call TextExportGetSettings . To set the value of the text export option, you call TextExportSetSettings .
The Text Export Settings dialog box also allows you to specify the time scale the text component uses to specify the fractional part of a time stamp. The value should be between 1 and 10000, inclusive. The text export component provides two functions you can use to access the component's time scale programmatically. To retrieve the time scale, call TextExportGetTimeFraction . To set the time scale, call TextExportSetTimeFraction .
| Previous | Chapter Contents | Chapter Top | Next |